﻿package core.net.socket.cmd {
	
	import core.net.socket.SocketCmd;
	import com.adobe.serialization.json.JSON;
	public class LoginCmd implements SocketCmd{
		
		public var mobile:String;
		public var password:String;
		public var remember:Boolean;
		public var auto:Boolean;
		
		public static var COMMAND_ID:String = "CMD_LOGIN";
		
		public function LoginCmd() {
			
		}
		
		
		public static function make(mobile:String,password:String,auto:Boolean):LoginCmd{
			var cmd:LoginCmd = new LoginCmd();
			cmd.mobile = mobile;
			cmd.password = password;
			cmd.remember=true;
			cmd.auto=auto;
			return cmd;
		}
		
		public function commandString():String{
			var obj = {
				cmd:COMMAND_ID,
				mobile:this.mobile,
				password:this.password,
				remember:this.remember,
				auto:this.auto
			};
			var str:String = com.adobe.serialization.json.JSON.encode(obj);
			return str;
		}
		
	}
	
}
